using System;
using System.Collections.Generic;
using System.Text;

using VisualGTest.Message;

namespace VisualGTest.Binding
{
    // a typical sequence of events:
    //
    //     [eventType]              [payloadType]
    //
    //     TestProgramStart         UNIT_TEST
    //     TestIterationStart       UNIT_TEST
    //     EnvironmentSetUpStart    UNIT_TEST
    //     EnvironmentSetUpEnd      UNIT_TEST
    //     TestCaseStart            TEST_CASE
    //     TestStart                TEST_INFO
    //     TestEnd                  TEST_INFO (test passed)
    //     TestStart                TEST_INFO
    //     TestPartResult           TEST_PART_RESULT (test failed)
    //     TestEnd                  TEST_INFO
    //     TestCaseEnd              TEST_CASE

    //     EnvironmentTearDownStart UNIT_TEST
    //     EnvironmentTearDownEnd   UNIT_TEST
    //     TestIterationEnd         UNIT_TEST
    //     TestProgramEnd           UNIT_TEST
    //
    interface ITestEventListener
    {
        void OnTestProgramStart(UnitTest unitTest);
        void OnTestIterationStart(UnitTest unitTest);
        void OnEnvironmentSetUpStart(UnitTest unitTest);
        void OnEnvironmentSetUpEnd(UnitTest unitTest);
        void OnTestCaseStart(TestCase testCase);
        void OnTestStart(TestInfo testInfo);
        void OnTestPartResult(TestPartResult testPartResult);
        void OnTestEnd(TestInfo testInfo);
        void OnTestCaseEnd(TestCase testCase);
        void OnEnvironmentTearDownStart(UnitTest unitTest);
        void OnEnvironmentTearDownEnd(UnitTest unitTest);
        void OnTestIterationEnd(UnitTest unitTest);
        void OnTestProgramEnd(UnitTest endedUnitTest);

        /// <summary>
        /// Called when an infrastructure-level error happens during test
        /// execution or data collection.
        /// </summary>
        /// <param name="ex"></param>
        void OnTestRunError(Exception ex);
    }
}
